import { RouteRecordRaw } from "vue-router";

export const routes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "登录注册页",
    component: () => import("../views/login/Login.vue"),
  },
  {
    path: "/",
    name: "浏览题目",
    component: () => import("../views/Home.vue"),
    meta: {
      show: true,
    },
  },
  // {
  //   path: "/user",
  //   name: "关于我的",
  //   component: () => import("../views/User.vue"),
  //   meta: {
  //     show: true,
  //   },
  // },
  // {
  //   path: "/admin",
  //   name: "系统管理",
  //   component: () => import("../views/Admin.vue"),
  //   meta: {
  //     show: true,
  //     access: "admin",
  //   },
  // },
  {
    path: "/admin/question",
    name: "问题管理",
    component: () => import("../views/questionManager.vue"),
    meta: {
      show: true,
      access: "admin",
    },
  },
  {
    path: "/add/question",
    name: "添加问题",
    component: () => import("../views/question.vue"),
    meta: {
      show: true,
      access: "admin",
    },
  },
  {
    path: "/update/question/:id",
    name: "更新问题",
    component: () => import("../views/question.vue"),
    meta: {
      show: false,
      access: "admin",
    },
    props: true,
  },
  {
    path: "/coding/:id",
    name: "编程页面",
    component: () => import("../views/codingPage.vue"),
    meta: {
      show: false,
    },
    props: true,
  },
  // 404页面匹配
  {
    path: "/:pathMatch(.*)*",
    name: "404",
    component: () => import("../views/404.vue"),
    meta: {
      show: false,
    },
  },
];
